<%@ page language="java" pageEncoding="UTF8"%>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic"%>
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> 
<%@ taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>

	<div id="createAccount">
		<p id="error">
			<logic:present name="messages">			
				<logic:iterate id="msg" name="messages" scope="request">
					<bean:message bundle="inter" key="${fn:escapeXml(msg)}"/>
				</logic:iterate>
			</logic:present>
		</p>

		<div class="d0">
			<html:form action="/modifyProfile" styleClass="formType1" >
				<input type="hidden" name="cmde" value="modifyProfile" />
				<fieldset>
					<legend><bean:message bundle="inter" key="profile.form.legend"/></legend>
					<p>
						<label><bean:message bundle="inter" key="profile.form.sexe"/>&nbsp;:</label>
						<p class="radiobox">
							<logic:equal value="0" name="user" property="gender" scope="session" >
								<input type="radio" name="gender" value="0" id="gender_np" checked="checked" />
							</logic:equal>
							<logic:notEqual value="0" name="user" property="gender" scope="session">
								<input type="radio" name="gender" value="0" id="gender_np" />
							</logic:notEqual>
							<label for="gender_np">&nbsp;<bean:message bundle="inter" key="profile.form.sexe.nonprecise"/></label>
							<logic:equal value="1" name="user" property="gender" >
								<input type="radio" name="gender" value="1" id="gender_f" checked="checked" />
							</logic:equal>
							<logic:notEqual value="1" name="user" property="gender" scope="session">
								<input type="radio" name="gender" value="1" id="gender_f" />
							</logic:notEqual>
							<label for="gender_f">&nbsp;<bean:message bundle="inter" key="profile.form.sexe.femme"/></label>

							<logic:equal value="2"name="user" property="gender" scope="session">
								<input type="radio" name="gender" value="2" id="gender_h" checked="checked" />
							</logic:equal>
							<logic:notEqual value="2" name="user" property="gender" scope="session">
								<input type="radio" name="gender" value="2" id="gender_h" />
							</logic:notEqual>
							<label for="gender_h">&nbsp;<bean:message bundle="inter" key="profile.form.sexe.homme"/></label>
						</p>
					</p>

					<p>
						<label for="lastName"><bean:message bundle="inter" key="profile.form.nom"/>&nbsp;:</label>
						<input type="text" name="lastName" id="lastName" class="mandatory" value="${fn:escapeXml(user.lastName)}" />
					</p>
					<p>
						<label for="firstName"><bean:message bundle="inter" key="profile.form.prenom"/>&nbsp;:</label>
						<input type="text" name="firstName" id="firstName" class="mandatory" value="${fn:escapeXml(user.firstName)}" /> 
					</p>
					<p>
						<label for="login"><bean:message bundle="inter" key="profile.form.login"/>&nbsp;:</label>
						<input type="text" name="login" id="login" class="mandatory" value="${fn:escapeXml(user.login)}" />
					</p>
					<p>
						<label for="password"><bean:message bundle="inter" key="profile.form.password"/>&nbsp;:</label>
						<input type="password" name="password" id="password" value="" />
					</p>
					<p>
						<label for="email"><bean:message bundle="inter" key="profile.form.courriel"/>&nbsp;:</label>
						<input type="text" name="email" id="email" class="mandatory" value="${fn:escapeXml(user.email)}" />
					</p>
				<!-- FREELANCE -->
				<logic:present name="freelance" scope="session">
					<p>
						<label for="fee"><bean:message bundle="inter" key="profile.form.salaire"/></label>
						<input type="text" name="fee" id="fee" value="${fn:escapeXml(freelance.fee)}"/>
					</p>
					<p>
						<label for="description"><bean:message bundle="inter" key="profile.form.description"/>&nbsp;:</label>
						<textarea name="description" id="description" cols="51" rows="5">${fn:escapeXml(freelance.description)}</textarea>
					</p>						
				</logic:present>
				<!-- COMPANY -->
				<logic:present name="company" scope="session">
					<p>
						<label for="name"><bean:message bundle="inter" key="profile.form.societe.nom"/>&nbsp;:&nbsp;</label>
						<input type="text" name="name" id="name" class="mandatory" value="${fn:escapeXml(company.name)}" />
					</p>
					<p>
						<label for="url"><bean:message bundle="inter" key="profile.form.societe.url"/>&nbsp;:&nbsp;</label>
						<input type="text" name="url" id="url" value="${fn:escapeXml(company.url)}" />
					</p>
					<p>
						<label for="address"><bean:message bundle="inter" key="profile.form.societe.addresse"/>&nbsp;:</label>
						<textarea name="address" id="address" cols="51" rows="5" >${fn:escapeXml(company.address)}</textarea>
					</p>
				</logic:present>
												
					<p>
						<input type="hidden" name="id" value="${fn:escapeXml(user.id)}" />
						<input type="submit" value="<bean:message bundle="inter" key="profile.form.submit"/> &rarr;"/>
					</p>
				</fieldset>
			</html:form>
		</div>
	</div>
